<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="layout" content="main"/>
    <title>Show Issue</title>
</head>
<body>
<div class="nav">
    <span class="menuButton"><a class="home" href="${createLinkTo(dir: '')}">Home</a></span>
    <span class="menuButton"><g:link class="list" action="list">Issue List</g:link></span>
    <span class="menuButton"><g:link class="create" action="create">New Issue</g:link></span>
</div>
<div class="body">
    <h1>Show Issue</h1>
    <g:if test="${flash.message}">
        <div class="message">${flash.message}</div>
    </g:if>
    <div class="dialog">
        <table>
            <tbody>
                <tr class="prop">
                    <td valign="top" class="name">Id:</td>

                    <td valign="top" class="value">${issue}</td>
                </tr>

                <tr class="prop">
                    <td valign="top" class="name">Project:</td>

                    <td valign="top" class="value"><g:link controller="project" action="show" id="${issue?.project?.id}">${issue?.project?.encodeAsHTML()}</g:link></td>
                </tr>

                <tr class="prop">
                    <td valign="top" class="name">Type:</td>

                    <td valign="top" class="value">${issue?.issueType?.encodeAsHTML()}</td>
                </tr>

                <tr class="prop">
                    <td valign="top" class="name">Severity:</td>

                    <td valign="top" class="value">${issue?.issueSeverity?.encodeAsHTML()}</td>
                </tr>

                <tr class="prop">
                    <td valign="top" class="name">Status:</td>

                    <td valign="top" class="value">${issue?.issueStatus?.encodeAsHTML()}</td>
                </tr>

                <g:if test="${issue?.issueResolution}">
                    <tr class="prop">
                        <td valign="top" class="name">Resolution:</td>

                        <td valign="top" class="value">${issue?.issueResolution?.encodeAsHTML()}</td>

                    </tr>
                </g:if>

                <tr class="prop">
                    <td valign="top" class="name">Assignee:</td>

                    <td valign="top" class="value"><g:link controller="user" action="show" id="${issue?.assignee?.id}">${issue?.assignee?.encodeAsHTML()}</g:link></td>

                </tr>

                <g:if test="${issue?.links}">
                    <tr class="prop">
                        <td valign="top" class="name">Links:</td>

                        <td valign="top" style="text-align:left;" class="value">
                            <ul>
                                <g:each var="l" in="${issue.links}">
                                    <li><g:link controller="issueLink" action="show" id="${l.id}">${l?.encodeAsHTML()}</g:link></li>
                                </g:each>
                            </ul>
                        </td>
                    </tr>
                </g:if>

                <tr class="prop">
                    <td valign="top" class="name">Summary:</td>

                    <td valign="top" class="value">${fieldValue(bean: issue, field: 'summary')}</td>

                </tr>

                <tr class="prop">
                    <td valign="top" class="name">Description:</td>

                    <td valign="top" class="value">${fieldValue(bean: issue, field: 'description')}</td>
                </tr>

                <g:if test="${issue.comments}">
                    <tr class="prop">
                        <td valign="top" class="name">Comments:</td>

                        <td valign="top" style="text-align:left;" class="value">
                            <ul>
                                <g:each var="c" in="${issue.comments}">
                                    <li><g:link controller="issueComment" action="show" id="${c.id}">${c?.encodeAsHTML()}</g:link></li>
                                </g:each>
                            </ul>
                        </td>

                    </tr>
                </g:if>
            </tbody>
        </table>
    </div>
    <div class="buttons">
        <g:form>
            <input type="hidden" name="id" value="${issue?.id}"/>
            <span class="button"><g:actionSubmit class="edit" value="Edit"/></span>
            <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete"/></span>

            <g:if test="${issue?.issueStatus == IssueStatus.OPEN || issue?.issueStatus == IssueStatus.IN_PROGRESS}">
                <span class="button"><g:actionSubmit class="resolve" value="Resolve"/></span>
            </g:if>
        </g:form>
    </div>
</div>
</body>
</html>
